home *** CD-ROM | disk | FTP | other *** search
- 'Script to create RRect Turbo Shape and add it to a TurboCAD drawing
- Global Const gkGRAPHIC = &H0B
- sub Main()
- Dim g As Long
- Dim r As Long
- Dim v As Long
-
- Dim e As String
-
- 'Create a graphic with kind = gkGraphic and Regen Method
- 'RRect.Rectangle. TCWGraphicCreate will cause OnNewGraphic
- 'to be called
- g = TCWGraphicCreate(gkGraphic, "RoundRect.Rectangle")
-
- 'if we got an error, display error message and stop
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- stop
- end if
-
- 'Need up update properties to get RegenGraphic to be called
- e = TCWGraphicPropertySet(g, "PenColor", &H00FF0000)
-
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- end if
-
- 'Add the graphic to the drawing
- TCWGraphicAppend 0, g
-
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- end if
-
- 'Force the graphic to be drawn on the drawing
- TCWGraphicDraw g, 0
- if (TCWLastErrorGet(e) <> 0) Then
- msgbox e
- end if
- end Sub
-